# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=dcd
pkgver=0.12.0
_githash=33dbd7653ecf830b735382e11d9bee66853a6dcf
pkgrel=1
pkgdesc="The D Completion Daemon is an auto-complete program for the D programming language"
url="https://github.com/dlang-community/DCD"
arch="x86 x86_64 aarch64" # ldc
license="GPL-3.0-or-later"
makedepends="ldc ldc-runtime stdx-allocator-dev dsymbol-dev libdparse-dev
	msgpack-d-dev dcontainers-dev bash"
options="!check" # Can only be run with a DMD version of DCD
source="https://github.com/dlang-community/DCD/archive/v$pkgver/dcd-$pkgver.tar.gz
	do-shared-linking.patch"
builddir="$srcdir/DCD-$pkgver"

prepare() {
	default_prepare

	mkdir bin
	echo $_githash > bin/githash.txt
}

build() {
	make DFLAGS="-link-defaultlib-shared" ldc
}

package() {
	install -d "$pkgdir"/usr/bin
	install -m0755 bin/dcd-client bin/dcd-server "$pkgdir"/usr/bin/
}

sha512sums="caadc5d497d6a209fda23523164247c1b921cebbe641fb6b5cedcecd20075d9283407f132886a369b15286c327e6a9e6015f290c31283e2a49a0e676b4cf82a9  dcd-0.12.0.tar.gz
3d0a85c47eca379ee350ba007200469e2c95ae3822d3826c275e6b4be7fa7d7d8e1c730fe971c6d67589888d94ea0c108581164952072ee9e956cf001298e21f  do-shared-linking.patch"
